require 'redcloth'

module MywikiHelper
# parse and return data as HTML
  def to_html(rawtext)
    return "" if rawtext.nil?
    
    r = RedCloth.new rawtext
    r.to_html    
  end
  
  def use_tinymce
    @content_for_tinymce = "" 
    content_for :tinymce do
      javascript_include_tag "tiny_mce/tiny_mce"
    end
    @content_for_tinymce_init = "" 
    content_for :tinymce_init do
      javascript_include_tag "mce_editor"
    end
  end

end
